package cn.simon.free.ratelimiter.core.providers;

/**
 * 缓存方式超类接口
 *
 * @author simon
 * @date 2020/3/25 10:43
 * @copyright:
 * @modifier
 * @motto a no talent, people who have to study hard
 */
public interface CacheProviders {

    /**
     * 获取缓存的值
     *
     * @return
     */
    Object getValue(String key);

    /**
     * 设置缓存值
     *
     * @param key
     * @param rate
     * @return
     */
    void putKey(String key, Object rate);

    /**
     * 检查当前Key是否限流
     *
     * @param key
     * @return
     */
    boolean checkAuthority(String key);
}
